﻿@using Share.Bonnet.AjaxDropDownList;
@model AjaxDropDownTest.Models.IndexViewModel
@{
    ViewBag.Title = "Index";
}
<h2>Index</h2>
<div class="row form-group">
    <div class="col-xs-6">
        @Html.DropDownListFor(
            model => model.Country,
            Model.CountryList,
            new {
                @class = "form-control"
            },
            Ajax.UpdateActionFor(
                model => model.City,
                new AjaxUpdateOptions {
                    DisableTargetWhenEmpty = true,
                    Url = Url.Action("CitySelectListJson")
                }
            ))
    </div>
    <div class="col-xs-6">
        @Html.DropDownListFor(
            model => model.City,
            Model.CityList,
            new {
                @class = "form-control",
                disabled = "disabled"
            })
    </div>
</div>
